package com.cncytech.uiautomator_demo.testcase;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;

import com.cncytech.uiautomator_demo.BaseTest;
import com.cncytech.uiautomator_demo.TestConstant;
import com.cncytech.uiautomator_demo.RetryWatcher;
import com.cncytech.uiautomator_demo.utils.Describe;

import org.junit.Rule;
import org.junit.Test;

/**
 * nfc 测试
 */
public class NFCPoliciesTest extends BaseTest {

    @Rule
    public RetryWatcher retryWatcher = new RetryWatcher(TestConstant.retryCount);


    @Test
    @Describe(TestConstant.NFC_FORBIDDEN)
    public void NFCforbiddenTest() {
        String msg = TestConstant.NFC_FORBIDDEN + "失败";
        int status = 0;
        assertThat(msg, hmm.setNfcPolicies(status));

        int nfcPolicies = hmm.getNfcPolicies();
        assertThat(msg, nfcPolicies, is(status));
    }

    @Test
    @Describe(TestConstant.NFC_ENABLE)
    public void NFCEnableTest() {
        String msg = TestConstant.NFC_ENABLE + "失败";
        int status = 1;
        assertThat(msg, hmm.setNfcPolicies(status));

        int nfcPolicies = hmm.getNfcPolicies();
        assertThat(msg, nfcPolicies, is(status));
    }

    @Test
    @Describe(TestConstant.NFC_CUSTOM)
    public void NFCCustomTest() {
        String msg = TestConstant.NFC_CUSTOM + "失败";
        int status = 2;
        assertThat(msg, hmm.setNfcPolicies(status));

        int nfcPolicies = hmm.getNfcPolicies();
        assertThat(msg, nfcPolicies, is(status));
    }
}
